package com.song.dubbpcustomer.config;

import com.alibaba.dubbo.common.extension.Activate;
import com.alibaba.dubbo.rpc.cluster.loadbalance.AbstractLoadBalance;
import org.apache.dubbo.common.extension.SPI;

import java.util.List;
@SPI
@Activate
public class LoadBalanceSelf extends AbstractLoadBalance {

    @Override
    protected <T> org.apache.dubbo.rpc.Invoker<T> doSelect(List<org.apache.dubbo.rpc.Invoker<T>> invokers, org.apache.dubbo.common.URL url, org.apache.dubbo.rpc.Invocation invocation) {
        invokers.forEach(item -> {
            System.out.println(item.getInterface());
            System.out.println(item.getUrl());
            System.out.println(item.getClass());
            System.out.println("---------------");
        });
        return invokers.get(0);
    }
}
